package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.query.AccidentQueryObject;
import cn.wolfcode.crm.service.IAccidentService;
import cn.wolfcode.crm.util.PageResult;
import cn.wolfcode.crm.util.PermissionName;
import com.alibaba.fastjson.JSON;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("clientInformationBill")
public class ClientInformationBillController {
    @Autowired
    private IAccidentService service;


    @RequestMapping("")
    @PermissionName("事故主页")
    @RequiresPermissions("accident:index")
    public String index() {
        return "clientInformationBill/list";
    }

    @RequestMapping("list")
    @ResponseBody
    @PermissionName("事故数据")
    public PageResult list(AccidentQueryObject qo) {
        System.err.println(JSON.toJSONString(service.query(qo)));

        PageResult result = service.query(qo);
        return result;
    }

}
